Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support


GS/OS
#2:    GS/OS and the 80-Column Firmware

Written by:    Matt Deatherage                                  November 1988

This Technical Note discusses the changes in handling the 80-column firmware 
between GS/OS and ProDOS 16.
_____________________________________________________________________________

For compatibility with the Apple IIe, the Apple IIGS does not treat slot 3 
like it treats other slots.  Instead of using a bit in the Slot Register 
($C02D) to control the mapping of ROM in slot 3 between the built-in 80-column 
firmware and any peripheral card physically in slot 3, the soft switches 
SETINTC3ROM ($C00A) and SETSLOTC3ROM ($C00B) are used instead.  On the Apple 
IIe, these soft switches (referred to by the single label SLOTC3ROM) 
respectively map the ROM at $C300 to the internal 80-column firmware (which 
works with the auxiliary-slot 80-column card in most IIe computers) or to a 
peripheral card in slot 3.  Note that writing to SETSLOTC3ROM on a IIe or IIGS 
with no card in slot 3 results in floating bus addresses in the $C300 space.

ProDOS 8 will not allow an Apple IIe or later model computer to have a card 
other than an 80-column card in slot 3.  ProDOS 8 needs the 80-column firmware 
on a 128K machine for use in the /RAM driver, and the enhanced Apple IIe has 
some of the interrupt firmware in the $C300 space.  When ProDOS 8 is loaded in 
an Apple IIe or later, it writes to SETSLOTC3ROM and looks at five 
identification bytes.  If all five of these bytes do not match, ProDOS 8 will 
write to SETINTC3ROM to use the internal firmware.  If all five bytes match, 
the external slot 3 ROM is left mapped in.

ProDOS 16 fell victim to a bug in ProDOS 8 versions 1.2 through 1.6 which 
always switched in the internal 80-column firmware, regardless of the user's 
Control Panel setting.  GS/OS does not have this bug; a card in slot 3 of a 
IIGS other than an 80-column card will not be mapped out by GS/OS.

Application programmers who require the 80-column firmware should be familiar 
of the following points:

o    If your program contains a routine to insure that the 80-column 
     firmware is indeed available, it could be buggy.  Since ProDOS 16 
     always made the 80-column firmware available, your routine to 
     check that condition may never have been executed.
o    If your program requires the 80-column firmware and it is not 
     available, your program should display a message on the screen 
     informing the user that he must set Slot 3 in the Control Panel to 
     Built-in Text Display for your program to execute, then gracefully 
     exit.  Switching the $C300 ROM space, even with the user's 
     permission, is not recommended.  Slot 3 could contain an operating 
     GS/OS device, perhaps even the one your program was launched from.  
     Remember, it is possible to boot  GS/OS from slot 3.

Do not try to be clever in a situation like this.  For example, do 
not go looking at ID bytes in slot 3 to try to determine the type 
of device present so that you can switch it out if you identify it 
as a non-disk device.  Slot 3 could contain an active device being 
operated by a loaded GS/OS driver.

Your program should not ask the user's permission to switch ROM 
space between ports and slots (or in this case, the internal 
firmware versus the external card).  That is why there is a 
Control Panel.  Simply display a message informing the user that 
he must set Slot 3 in the Control Panel to Built-in Text Display 
for your program to execute.  You may offer to change the battery 
RAM parameter for the user and restart the system (using the 
OSShutdown call), but under no circumstances should you hit the 
soft switch yourself, even with the user's permission.


Further Reference
o    GS/OS Reference, Volume 1
o    ProDOS 8 Technical Note #15, How ProDOS 8 Treats Slot 3

